
#ifndef EDITORTOOL_H
#define EDITORTOOL_H

#include <QPoint>
#include <QPaintDevice>
#include <QWidget>
#include <QSharedPointer>
#include <QPen>
#include <QRect>

class ImageEditor;
class EditorTool
{
public:
	EditorTool(const QString& id, ImageEditor* parent = 0);
	virtual ~EditorTool();

	void setImage(QImage* device);
	QImage* image();

	void setWidget(QWidget* w);
	QWidget* widget();

	void setPen(QPen p);
	QPen pen();

	QString id();

	virtual void mousePress(const QPoint& p) = 0;
	virtual void mouseRelease(const QPoint& p) = 0;
	virtual void mouseMove(const QPoint& p) = 0;
	virtual QRect draw(QPainter* p) = 0;

	ImageEditor* parent();

private:
	QString m_id;
	QImage* m_paintDevice;
	QWidget* m_widget;
	QPen m_pen;
	ImageEditor* m_parent;
};

typedef QSharedPointer<EditorTool> EditorToolPtr;

#endif

